/**
 * Copyright &copy; 2015-2020 <a href="http://www.easyhis.com/">easyhis</a> All rights reserved.
 */
package com.easy.dfcshop.mapper;

import com.easy.core.persistence.annotation.MyBatisMapper;
import com.easy.dfcshop.entity.ActivityEnroll;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * 厂家的活动报名表MAPPER接口
 * @author waylen chi
 * @version 2018-01-11
 */
@MyBatisMapper
public interface ActivityEnrollMapper {

    /**
     * 获取单条数据
     * @param id
     * @return
     */
    public ActivityEnroll get(String id);

    /**
     * 获取单条数据
     * @param enrollId
     * @return
     */
    public ActivityEnroll getByEnrollId(Integer enrollId);

    /**
     * 获取单条数据
     * @param entity
     * @return
     */
    public ActivityEnroll get(ActivityEnroll entity);

    /**
     * 根据实体名称和字段名称和字段值获取唯一记录
     *
     * @param propertyName
     * @param value
     * @return
     */
    public ActivityEnroll findUniqueByProperty(@Param(value = "propertyName") String propertyName, @Param(value = "value") Object value);


    /**
     * 查询数据列表，如果需要分页，请设置分页对象，如：area.setPage(new Page<ActivityEnroll>());
     * @param entity
     * @return
     */
    public List<ActivityEnroll> findList(ActivityEnroll entity);

    /**
     * 查询所有数据列表
     * @param entity
     * @return
     */
    public List<ActivityEnroll> findAllList(ActivityEnroll entity);

    /**
     * 查询所有数据列表
     * @see public List<ActivityEnroll> findAllList(ActivityEnroll entity)
     * @return
     */
    @Deprecated
    public List<ActivityEnroll> findAllList();

    /**
     * 插入数据
     * @param entity
     * @return
     */
    public int insert(ActivityEnroll entity);

    /**
     * 更新数据
     * @param entity
     * @return
     */
    public int update(ActivityEnroll entity);

    /**
     * 删除数据（物理删除，从数据库中彻底删除）
     * @param id
     * @see public int delete(ActivityEnroll entity)
     * @return
     */
    @Deprecated
    public int delete(String id);

    /**
     * 删除数据（逻辑删除，更新del_flag字段为1,在表包含字段del_flag时，可以调用此方法，将数据隐藏）
     * @param id
     * @see public int delete(ActivityEnroll entity)
     * @return
     */
    @Deprecated
    public int deleteByLogic(String id);

    /**
     * 删除数据（物理删除，从数据库中彻底删除）
     * @param entity
     * @return
     */
    public int delete(ActivityEnroll entity);

    /**
     * 删除数据（逻辑删除，更新del_flag字段为1,在表包含字段del_flag时，可以调用此方法，将数据隐藏）
     * @param entity
     * @return
     */
    public int deleteByLogic(ActivityEnroll entity);

    @Select("${sql}")
    public List<Object> execSelectSql(@Param(value = "sql") String sql);

    @Update("${sql}")
    public void execUpdateSql(@Param(value = "sql") String sql);

    @Insert("${sql}")
    public void execInsertSql(@Param(value = "sql") String sql);

    @Delete("${sql}")
    public void execDeleteSql(@Param(value = "sql") String sql);

    public void updateTradeNo(@Param(value = "payId") String payId, @Param(value = "tradeNo") String tradeNo);

    public ActivityEnroll findByTradeNo(@Param(value = "outTradeNo") String outTradeNo);

    public void updateSucessStatus(@Param(value = "enrollId") String enrollId);
}